using System.Collections.Generic;

using com.tc.zigbee.zcl;

using com.tc.util;
namespace com.tc.zigbee.zcl.command
{
    public class Report : AbstractZclCommand
    {
        public List<AttributeRecord> getAttributes()
        {
            return attributes;
        }
        List<AttributeRecord> attributes = new List<AttributeRecord>();
        public Report(byte[] data)
        {
            int i = 0;
            while (i < data.Length)
            {

                short attribute = DataUtil.shortValue(data);
                i += 2;
                byte dataType = data[i++];
                DataType dt = DataTypeManager.types[dataType];
                DataValue value = dt.value(data, i);
                i += dt.getLength();
                AttributeRecord r = new AttributeRecord(attribute, (byte)0, value);
                attributes.Add(r);

            }

        }
    }
}
